package com.wcl.demo.ui.fragment;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.DialogFragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.widget.TextView;

import com.wcl.demo.R;
import com.wcl.demo.ui.activity.ChangeNoteBgActivity;

/**
 * Created by dllo on 15/12/2.
 */
public class NoteBgDialogFragment extends DialogFragment implements View.OnClickListener {
    private TextView dialog_bg_change_photo_Btn,dialog_bg_bac_Btn;

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        getDialog().requestWindowFeature(Window.FEATURE_NO_TITLE);
        return inflater.inflate(R.layout.fragment_note_bg_dialog,container);
    }

    @Override
    public void onViewCreated(View view,Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);
        dialog_bg_change_photo_Btn= (TextView) view.findViewById(R.id.dialog_bg_change_photo_Btn);
        dialog_bg_bac_Btn= (TextView) view.findViewById(R.id.dialog_bg_bac_Btn);
    }

    @Override
    public void onActivityCreated(Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
        dialog_bg_change_photo_Btn.setOnClickListener(this);
        dialog_bg_bac_Btn.setOnClickListener(this);


    }

    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.dialog_bg_change_photo_Btn:
                Intent intent=new Intent(getActivity(), ChangeNoteBgActivity.class);
                getActivity().startActivity(intent);
                getActivity().finish();
                break;
            case R.id.dialog_bg_bac_Btn:

                break;
        }
    }
}
